<template>
  <div>
    <el-dialog title="订单详情" :visible.sync="dialogVisible" width="30%" :before-close="closeDialog">
      <div class="ongoing">正在进行中</div>
      <div class="order-detail">
        <div class="people-num d-flex">
          <div class="left d-flex mr-10">
            <div class="d-flex-column mr-10">
              <el-avatar :size="50" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
              <p style="text-align:center">昵称</p>
            </div>
            <div class="d-flex-column mr-10">
              <el-avatar :size="50" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
              <p style="text-align:center">昵称</p>
            </div>
            <div class="d-flex-column mr-10">
              <el-avatar :size="50" src="https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png" />
              <p style="text-align:center">昵称</p>
            </div>
          </div>
          <div class="right">
            <p>拼团号 9459809580</p>
            <p>已有3人拼单，还剩1人</p>
            <p>剩余时间10:20:02</p>
          </div>
        </div>
        <div class="title">拼主信息</div>
        <div class="row-wrapper">
          <div class="row">
            <ul>
              <li>订单号：{{ tableData.order_no }}</li>
              <li>用户：{{ tableData.nickname }}</li>
              <li>下单时间：{{ tableData.created_at }}</li>
              <li class="pay">应付总金额：¥{{ tableData.payment }}</li>
            </ul>
          </div>
        </div>
      </div>
      <div class="goods-info">
        <div class="title">拼单的人</div>
        <div v-for="(item, index) of tableData.commodity" :key="index" class="row-wrapper">
          <div class="row">
            <ul>
              <li>订单号：{{ tableData.order_no }}</li>
              <li>用户：{{ tableData.nickname }}</li>
              <li>下单时间：{{ tableData.created_at }}</li>
              <li class="pay">应付总金额：¥{{ tableData.payment }}</li>
            </ul>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
export default {
  props: {
    orderDetail: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      dialogVisible: false,
      tableData:
        {
          order_no: 201809271010,
          nickname: '智休科技',
          clerk: '韩韩',
          payment: '60.00',
          created_at: '2018-09-27 10:10',
          type: '单节',
          pattern: '卷码',
          commodity: [
            {
              order_no: 201809271010,
              nickname: '智休科技',
              clerk: '韩韩',
              payment: '60.00',
              created_at: '2018-09-27 10:10',
              type: '单节',
              pattern: '卷码'
            },
            {
              order_no: 201809271010,
              nickname: '智休科技',
              clerk: '韩韩',
              payment: '60.00',
              created_at: '2018-09-27 10:10',
              type: '单节',
              pattern: '卷码'
            }
          ]
        }

    }
  },
  methods: {
    closeDialog() {
      this.dialogVisible = false
    },
    show() {
      this.dialogVisible = true
    },
    hide() {
      this.dialogVisible = false
    }
  }
}
</script>
<style lang="scss" scoped>
.el-dialog__wrapper /deep/ .el-dialog {
  min-width: 1100px;
  .el-dialog__body{
    padding-top: 0 !important;
  }
}
.el-dialog__wrapper /deep/ .el-dialog__close{
    position: absolute;
    top: -55px;
    font-size: 24px;
    line-height: 24px;
    font-weight: bold;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 1);
}
.ongoing{
  position: absolute;
  right: 30px;
  top: 30px;
  color: red;
}
.order-detail, .goods-info{
  margin-top: 23px;
  .title {
    height: 26px;
    line-height: 26px;
    color: rgba(68, 68, 68, 1);
    font-size: 16px;
    text-align: center;
    font-family: Roboto;
    text-align: left;
    font-weight: bold;
  }
  .row-wrapper {
    background-color: rgba(250, 250, 250, 1);
    border: 1px solid rgba(235, 238, 245, 1);
    padding: 23px 38px;
    box-sizing: border-box;
    margin-top: 8px;
    .row {
      ul {
        display: flex;
        justify-content: space-between;
        li {
          flex-basis: 30%;
          line-height: 20px;
          color: rgba(102, 102, 102, 1);
          font-size: 14px;
          text-align: center;
          font-family: Roboto;
          list-style: none;
          text-align: left;
          margin-left: 20px;
          white-space: nowrap;
          &.pay{
            color: red;
          }
        }
      }
    }
  }
}
.goods-info{
  .row-wrapper{
    .row{
      ul{
        li{
          flex-basis: 20%;
        }
      }
    }
  }
}
.d-flex-column{
  display: flex;
  flex-direction: column;
}
.d-flex{
  display: flex;
  align-items: center;
}
.mr-10{
  margin-right:10px;
}
</style>
